﻿using ASmile.Com;
using ASmile.Com.Com;
using ASmile.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASmile.Win.DaBLL
{
    /// <summary>
    /// 公共的BLL对象, 用于选择，字典查询，等
    /// </summary>
    public class ComBLL : BLLBase, IComBLL
    {
        protected override string ControllerName => "ASmile/Com";

        public ApiResult<Sys_User> GetUserInfo()
        {
            return GetResult<Sys_User>();
        }

        public ApiResult SetUserInfo(Sys_User arg)
        {
            return GetResult(arg);
        }

        public ApiResult<RetLoginVerify> LoginVerify(ArgLoginVerify arg)
        {
            var ret = GetResult<RetLoginVerify>(arg);
            if (ret)
            {
                TokenHelper.SetToken(ret.data.Token);
            }
            return ret;

        }

        [WebApi("SysManage/UserManage", "GetList")]
        public ApiResultList<Sys_User> SearchUsers(ArgPageData arg)
        {
            return GetResultList<Sys_User>(arg);
        }

    }
}